<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<BreukenWebsite.Models.Opdracht>>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    Overzicht
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <script type="text/javascript">
        $(document).ready(function() {
            $("#myTable").tablesorter();
        });
    </script>
    <h2>Overzicht</h2>
    
    <table id="myTable" class="tablesorter">
    <thead>
        <tr>
            <th>
                Datum
            </th>
            <th>
                Moeilijkheidsgraad
            </th>
            <th>
                Maximumscore
            </th>
            <th>
                Status
            </th>
            <th>Maak Opdracht / Afgewerkt</th>
        </tr>
    </thead>
    <tbody>
        <% foreach (var item in Model)
           { %>
        <tr>
            <td>
                <%= Html.Encode(String.Format("{0:g}", item.opdrachtDatum.ToShortDateString())) %>
            </td>
            <td>
                <%= Html.Encode(item.moeilijkheidsGraad) %>{}
            </td>
            <td>
                <%= Html.Encode(item.maxScore) %>
            </td>
            <td>
                <%= Html.Encode(item.status) %>
            </td>
            <td>
                <% if (!item.status)
                   { %>
                    <%= Html.ActionLink("_IMG_", "MaakOpdracht", new { id = item.opdrachtID }).Replace("_IMG_", "<img alt=\"Maak Opdracht\" src=\"../../Content/icons/page_edit.png\"/>")%>
                <% } else { %>
                    <img alt="Afgewerkt" src="../../Content/icons/accept.png"/>
                <% } %>
            </td>
        </tr>
        <% } %>
    </tbody>
    </table>
    
</asp:Content>
